#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N = 2100;
double dis[N];
int st[N];
double g[N][N];
int n, m, S, E;
void dijkstra()
{
	memset(dis, 0, sizeof(dis));
	dis[S] = 1;
	for (int i = 0; i < n; i++) {
		int t = -1;
		for (int j = 1; j <= n; j++) {
			if (!st[j] && (t == -1 || dis[j] > dis[t])) {
				t = j;
			}
		}
		st[t] = 1;
		for (int j = 1; j <= n; j++) {
			dis[j] = max(dis[j], dis[t] * g[t][j]);
		}
	}
}
int main()
{
	cin >> n >> m;
	memset(g, 0, sizeof(g));
	while (m--) {
		int a, b, u;
		cin >> a >> b >> u;
		double z = (100 - u) / 100.0;
		g[a][b] = g[b][a] = max(g[a][b], z);
	}
	cin >> S >> E;
	dijkstra();
	printf("%.8lf\n",100 / dis[E]);
	return 0;
}